<div class="main">
    <?php if (!isset($_SESSION["user_id"])) { ?>
        <form action="connexion.php" method="post" class="center-block half-size">
            <?php if(isset($_GET['redirect'])) { ?>
                <input type="hidden" name="redirect" value="<?= $_SERVER['HTTP_REFERER'] ?>" />
            <?php } ?>
            <div class="input-group input-group-lg">
				<span class="input-group-addon">
					<label for="nom">Login</label>
				</span>
                <input type="text" name="login" id="nom" class="form-control" required autofocus />
			</div>
            <br />
            <div class="input-group input-group-lg">
				<span class="input-group-addon">
					<label for="pwd">Password</label>
				</span>
                <input type="password" name="password" id="pwd" class="form-control" />
            </div>
			<br/>
            <div class="form-group">
                <label>
                    <input class="checkbox inline-form" type="checkbox" name = "connexion_auto" value="True" /> Connexion automatique
                </label>
            </div>
            <input type="submit" name="valider" value="Connexion" class="btn btn-primary btn-lg btn-block" />
        </form>
        <?php if (isset($error)) { ?>
            <br />
            <div class="alert alert-danger center-block text-center half-size">
                <?= $error ?>
            </div>
        <?php
        }
    }else { ?>
        <div class="alert alert-danger center-block text-center half-size">
            Vous êtes déjà connecté !
        </div>
    <?php } ?>
</div>